package com.day01.source;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class MapSource {

    private Map<String, List<String>> data = new HashMap<>();

    public void addKey(String key, String value) {
        if (!data.containsKey(key)) {
            List<String> values = new ArrayList<>();
            data.put(key, values);
        }
        List<String> values = data.get(key);
        values.add(value);
    }

    public String[] keys() {
        return data.keySet().toArray(new String[0]);
    }
}
